<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/head.jsp"%>
<div class="bjui-pageContent">
	<form action="${ctx}/sys/update${actionclass}.do" id="j_custom_form" data-toggle="validate" data-alertmsg="false">
		<input type="hidden" value="${modifybean.id}" name="id" />
		<input type="hidden" value="${modifybean.question}" name="question" />
		<input type="hidden" value="${modifybean.answer}" name="answer" />
		<table class="table table-condensed table-hover" width="100%">
			<tbody>
				<tr>
					<td>
						<label class="control-label x150">头像：</label>
						<div style="display: inline-block; vertical-align: middle;">
							<div id="j_custom_pic_up" 
								data-toggle="upload" data-uploader="${ctx}/com/fileUpload.do"
								data-file-size-limit="2024000000" 
								data-file-type-exts="*.jpg;*.png;*.gif;*.mpg" 
								data-multi="true"
								data-on-upload-success="pic_upload_success"
								data-file-obj-name="upload" 
								data-icon="cloud-upload">
							</div>
							<input type="hidden" name="photo" data-rule="" value="${modifybean.photo}" id="j_custom_pic">
							<span id="j_custom_span_pic">
							<img alt="" src="${ctx}/resource/${modifybean.photo}" style="border-radius:0.1em;" width="120px" onerror="javascript:this.src='${ctx}/resource/no-head.png'"><br/>
							</span>
						</div>
					</td>
				</tr>	
				<tr>
					<td>
						<label for="CourseClazz_clazz" class="control-label x150">班级：</label>
						<select name="clazzId" id="CourseClazz_clazz" data-toggle="selectpicker" data-rule="required" data-width="300">
							<c:forEach items="${list }" var="item">
								<option value="${item.id }">${item.name }</option>
							</c:forEach>
						</select>
					</td>
				</tr>		
				<tr>
					<td>
						<label for="${actionclass}_uname" class="control-label x150">账号：</label>
						<input type="text" name="uname" value="${modifybean.uname}" id="${actionclass}_uname" data-rule="required"
							size="15" readonly="readonly">
					</td>
				</tr>
				<tr>
					<td>
						<label for="${actionclass}_userPassword" class="control-label x150">密码：</label>
						<input type="password" name="userPassword" value="" id="${actionclass}_userPassword" data-rule=""
							size="15">
					</td>
				</tr>
				<tr>
					<td>
						<label for="${actionclass}_userName" class="control-label x150">姓名：</label>
						<input type="text" name="userName" value="${modifybean.userName}" id="${actionclass}_userName"
							data-rule="required" size="15">
					</td>
				</tr>
				<tr>
					<td>
						<label for="${actionclass}_userGender" class="control-label x150">性别：</label>
						<select name="userGender" id="${actionclass}_userGender" data-toggle="selectpicker" data-rule="required" data-width="150">
							<option value="女">女</option>
							<option value="男">男</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>
						<label for="${actionclass}_userPhone" class="control-label x150">联系电话：</label>
						<input type="text" name="userPhone" value="${modifybean.userPhone}" id="${actionclass}_userPhone"
							data-rule="mobile" size="15" maxlength="11">
					</td>
				</tr>
				<tr>
					<td>
						<label for="${actionclass}_userEmail" class="control-label x150">邮箱：</label>
						<input type="text" name="userEmail" value="${modifybean.userEmail}" id="${actionclass}_userEmail"
							data-rule="email" size="15">
					</td>
				</tr>
				<tr>
					<td>
						<label for="${actionclass}_userBirth" class="control-label x150">出生日期：</label>
						<input type="text" name="userBirth" value="${modifybean.userBirth}" id="${actionclass}_userBirth"
							data-toggle="datepicker" data-pattern="yyyy-MM-dd" readonly="readonly" size="15">
					</td>
				</tr>
				<tr>
					<td>
						<label for="${actionclass}_userAddress" class="control-label x150">联系地址：</label>
						<input type="text" name="userAddress" value="${modifybean.userAddress}" id="${actionclass}_userAddress"
							data-rule="" size="45">
					</td>
				</tr>

			</tbody>
		</table>
	</form>
</div>
<div class="bjui-pageFooter">
	<ul>
		<li>
			<button type="button" class="btn-close" data-icon="close">取消</button>
		</li>
		<li>
			<button type="submit" class="btn-default" data-icon="save">保存</button>
		</li>
	</ul>
</div>
<script type="text/javascript">
	$("#${actionclass}_userGender").val("${modifybean.userGender}");
	$("#CourseClazz_clazz").val("${modifybean.clazzId}");
</script>
<script type="text/javascript">
	function pic_upload_success(file, data) {
		var json = $.parseJSON(data)
		$(this).bjuiajax('ajaxDone', json)
		if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
			$('#j_custom_pic').val(json.filename).trigger('validate')
			$('#j_custom_span_pic').html('<img src="${ctx}/resource/' + json.filename + '" width="100" />')
		//$('#j_custom_span_pic').html(json.filename)
		}
	}
</script>